package io.renren.modules.shop.service.impl;

import io.renren.modules.shop.entity.CollectsEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.shop.dao.CollectDao;
import io.renren.modules.shop.entity.CollectEntity;
import io.renren.modules.shop.service.CollectService;

import javax.annotation.Resource;


@Service("collectService")
public class CollectServiceImpl extends ServiceImpl<CollectDao, CollectEntity> implements CollectService {

    @Resource CollectDao collectDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CollectEntity> page = this.page(
                new Query<CollectEntity>().getPage(params),
                new QueryWrapper<CollectEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CollectsEntity> getCollects(Long id) {
        return collectDao.getCollects(id);
    }

}
